package turtle.formatter.web.controller;

import com.turtle.turtleformatter.formatter.DateFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class FormatterController {
    @Autowired
    private DateFormatter dateFormatter;

    @GetMapping("/date")
    public String date(){
        Date date = new Date();
        String result = dateFormatter.formatDate(date);
        return result;
    }
}
